package ${controllerPackage}.${prefix}.request;

import cn.jg.framework.common.bean.Converter;
import ${modelPackage}.${prefix}.${modelName};
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
<#list importList as import>
import ${import};
</#list>

/**
 * Created by ${author} on ${date}.
 */
@Data
public class ${modelName}CreateRequest implements Converter<${modelName}CreateRequest, ${modelName}> {
<#assign sysFields=["createTime","updateTime","createUserId","updateUserId","companyId","languageCode","deleteFlag"]>
<#list columnInfoList as col>
    <#if !sysFields?seq_contains(col.modelColumnName)>

    <#if col.comment?length gt 1>
    /**
     * ${col.comment}
     */
    </#if>
    <#if col.stringLength??>
    @Length(max = ${col.stringLength},message = "${col.modelColumnName}长度不能超过${col.stringLength}字符")
    </#if>
    private ${col.javaType} ${col.modelColumnName};
    </#if>
</#list>

    @Override
    public ${modelName} convert(${modelName}CreateRequest request) {
        ${modelName} ${modelNameLowerCamel} = ${modelName}Mapper.INSTANCE.convert(request);
        return ${modelNameLowerCamel};
    }

    @Mapper
    interface ${modelName}Mapper {
        ${modelName}Mapper INSTANCE = Mappers.getMapper(${modelName}Mapper.class);

        ${modelName} convert(${modelName}CreateRequest request);
    }
}